import React, {Component} from "react";

const detailData = [
    {id: '01', content: '你好，中国'},
    {id: '02', content: '你好，西安'},
    {id: '03', content: '你好，武汉'}
]

export default class Detail extends Component {
    render() {
        console.log(this.props);
        // 从 props 中接收 params 参数
       const {id, title } = this.props.match.params;
       const result = detailData.find((detailObj) => {
           return detailObj.id === id;
       })

        return (
            <ul>
                <li>ID: {id}</li>
                <li>Title: {title}</li>
                <li>Content: {result.content}</li>
            </ul>
        );
    }
}